package main

import (
	"fmt"
	"math/rand"
	"sort"
	"time"
)

func main() {
	rand.Seed(time.Now().UnixNano()) // 生成随机数种子池
	var num = make(map[int]int, 200)
	for i := 0; i < 100; i++ {
		num[i] = rand.Intn(100)
	}
	var key = make([]int, 0, 200)
	for keys := range num {
		key = append(key, keys) // key 为0-100的索引
	}
	fmt.Println(key)
	sort.Ints(key)
	for _, j := range key {
		fmt.Println(key[j], num[j])
	}

}
